package com.changgou.seckill.dao;

import com.changgou.seckill.pojo.SeckillOrder;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;


public interface SeckillOrderMapper extends Mapper<SeckillOrder> {

    /**
     * 按照用户名和商品id查找订单表中是否有订单
     *
     * @param username
     * @param id
     * @return com.changgou.seckill.pojo.SeckillOrder
     * @throws
     * @description
     * @author kfzhao
     * @date 2022/1/7 2:21
     */
    @Select("select * from tb_seckill_order where user_id=#{username} and seckill_id=#{id}")
    SeckillOrder getOrderInfoByUsernameAndGoodsId(@Param("username") String username, @Param("id") Long id);
}
